<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ include file="../common.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="${ctx}/v2.3/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/v2.3/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/v2.3/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/v2.3/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>新建邮件</title>
</head>
<body>
<div class="pd-20">
	<form method="post" class="form form-horizontal" id="form-email-add">
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>发件人：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="lifeng_it@163.com" placeholder="" id="from" name="from" datatype="e" nullmsg="发件人不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>发件人名称：</label>
			<div class="formControls col-5">
				<input type="text" placeholder="输入发件人姓名" autocomplete="off" value="" class="input-text" datatype="*2-4" nullmsg="发件人名称不能为空" name="fromName">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>收件人：</label>
			<div class="formControls col-5">
				<input type="text" placeholder="收件人(多人之间用逗号隔开)" autocomplete="off" class="input-text Validform_error" errormsg="请输入正确收件人格式" datatype="*" nullmsg="收件人不能为空！" id="toEmails" name="toEmails" />
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>主题：</label>
			<div class="formControls col-5 skin-minimal">
				<input type="text" placeholder="请输入邮件主题" autocomplete="off" class="input-text Validform_error" errormsg="主题长度必须是1到20位之间" datatype="*1-20" nullmsg="主题不能为空！" id="subject" name="subject" />
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>内容：</label>
			<div class="formControls col-5">
				<textarea id="context" name="context" cols="" rows="" class="textarea"  placeholder="邮件内容...500个字符以内" 
				errormsg="邮件内容...500个字符以内" datatype="*1-500" nullmsg="内容不能为空！" dragonfly="true" onKeyUp="textarealength(this,500)"></textarea>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<!-- <button class="btn btn-primary radius" onclick="save()" id="save" name="save" flag="1" value="">&nbsp;&nbsp;暂存&nbsp;&nbsp;</button> -->
				<button class="btn btn-primary radius" onclick="save_send()" id="save_send" name="save" flag="2" value="&nbsp;&nbsp;保存并发送&nbsp;&nbsp;">&nbsp;&nbsp;保存并发送&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="${ctx}/v2.3/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${ctx}/v2.3/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="${ctx}/v2.3/lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="${ctx}/v2.3/lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="${ctx}/v2.3/js/H-ui.js"></script> 
<script type="text/javascript" src="${ctx}/v2.3/js/H-ui.admin.js"></script> 
<script type="text/javascript">
$(function(){
	
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-email-add").Validform({
		tiptype:2,
		callback:function(form){
			$("#form-email-add").attr("action","${ctx}/email/save_send.action");
			$("#form-email-add").submit();
			parent.location.reload();
			layer_close();
		}
	});
	
	/* var mySubmit = $(":input[name='save']");
	mySubmit.each(function(){
		$(this).click(function(){
			if($(this).attr("flag") == "1"){
				$("#form-email-add").attr("action","${ctx}/email/save.action");
			}else{
				$("#form-email-add").attr("action","${ctx}/email/save_send.action");
			}
		});
	});
	//$(form[0]).attr("action","${ctx}/email/save_send.action");
	$(form[0]).submit(); */
	
	function save(){
		$("#form-email-add").attr("action","${ctx}/email/save.action");
		$("#form-email-add").submit();
		parent.location.reload();
		layer_close();
	}
	function save_send(){
		alert("");
		$("#form-email-add").attr("action","${ctx}/email/save_send.action");
		$("#form-email-add").submit();
		parent.location.reload();
		layer_close();
	}
});
</script>
</body>
</html>